As rate control in generating encoded video data, there are a constant bit rate (CBR) encoding system and a variable bit rate (VBR) encoding system. In the CBR encoding system, a code amount (bit rate) per unit time in encoded video data is controlled to be constant. Therefore, in the CBR encoding system, when the encoded video data is recorded in a recording medium that has a limited storage capacity, a time to be able to record the video data in the recording medium can be accurately predicted. However, in the CBR encoding system, there are problems that the generated code amount is suppressed with respect to a complicated scene that requires a large code amount, and thus image quality is deteriorated. Further, a large code amount is generated with respect to a monotonous scene that needs only a small code amount, and thus a more storage capacity than necessary is required for the monotonous scene, in recording the video data.
In contrast, in the VBR encoding system, the generated code amount can be limited to a minimum necessary amount while high image quality is secured. However, in principle, the bit rate varies depending on a scene. Therefore, in the VBR encoding system, there is a drawback that the generated code amount per unit time cannot be predicted, and when the video data is recorded in a recording medium having a limited storage capacity, how many hours of video data can be recorded in the recording medium cannot be predicted.
As a system to solve the problem of the VBR encoding system, a two-pass VBR encoding system is known, in which, first, a standard quantization parameter is set and tentative encoding is performed, and a generated code amount is calculated, and then the image is actually encoded. According to the two-pass VBR encoding system, the actual encoding is performed after characteristics of the entire content are known through the tentative encoding. Therefore, the image can have high image quality to a maximum extent while being able to be stored in the target storage capacity. However, in the two-pass VBR encoding system, the actual encoding is performed after the tentative encoding is completed with respect to the entire content, and thus real time recording cannot be performed.
As a system to solve the above problem of the VBR encoding system in real time, there is a one-pass VBR encoding system, in which encoding is performed without performing the tentative encoding. As an image encoding device that employs the one-pass VBR encoding system, there is an image encoding device described in Patent Literature 1. In this image encoding device, in encoding a moving image, image complexity of each first image unit (for example, one GOP) is calculated according to a generated code amount of when input image data is encoded with a predetermined quantization parameter, and the quantization parameter, average image complexity of encoded images from start of the encoding to a current time is calculated according to the quantization parameter and the generated code amounts, smaller image complexity is selected between the image complexity of each first image unit and the average image complexity, a quantization parameter of the first image unit is calculated according to an average bit rate, and the quantization parameter is adjusted in each second image unit (for example, a macroblock) according to the generated code amount, and excess and deficit from the average bit rate set in advance. Therefore, the code amount can be control in real time, and encoding with high image quality can be achieved, in the VBR encoding system.